<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ page import="com.zl.pojo.Dept" %>
<%--<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>--%>
<%
    String basePath = "http://192.168.1.120:8050/empMaven/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <title>修改员工</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
</head>
<body>
    <form action="emp/updateEmp" method="post" enctype="multipart/form-data">
        员工编号:<input name="empNo" type="text" readonly="readonly" value="${emp.empNo}"><p/>
        员工姓名:<input name="ename" type="text" value="${emp.ename}"><p/>
        员工头像:<img src="${emp.img}"/>
            <input name="userImg" type="file"><p/>
        员工岗位:<input name="job" type="text" value="${emp.job}"><p/>
        上级领导:<select name="mgr">
                    <option value="">--请选择--</option>
                    <c:forEach items="${mgrs}" var="e">
                        <option <c:if test="${e.empNo==emp.mgr}">selected="selected"</c:if> value="${e.empNo}">${e.ename}</option>
                    </c:forEach>
                </select><p/>
        入职日期:<input name="hireDate" type="date" value="<c:if test="${emp.hireDate!=null}"><fmt:formatDate value="${emp.hireDate}" pattern="yyyy-MM-dd"></fmt:formatDate></c:if>"><p/>

        员工工资:<input name="sal" type="text" value="${emp.sal}"><p/>
        员工奖金:<input name="comm" type="text" value="${emp.comm}"><p/>
        员工部门:<select name="dept.deptNo">
                    <option value="">--请选择--</option>
                    <c:forEach items="${depts}" var="d">
                        <option <c:if test="${d.deptNo==emp.dept.deptNo}">selected="selected"</c:if> value="${d.deptNo}">${d.deptNo}${d.dname}</option>
                    </c:forEach>
                </select><p/>
        <input type="submit" value="确定修改">
        <input type="reset" value="重置表单">
    </form>
</body>
</html>